package com.ruoyi.purchase.feign.client;


import com.ruoyi.base.domain.SettlementAccount;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.purchase.feign.fallback.GoodsFallbackFactory;
import com.ruoyi.base.domain.Goods;
import com.ruoyi.base.domain.Inventory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient(value = "ruoyi-base", fallbackFactory = GoodsFallbackFactory.class )
public interface GoodsFeignClient {

    @GetMapping(value = "/goods/getGoodsById/{id}")
    Goods getGoodsById(@PathVariable("id") Long id);

    @PostMapping("/inventory/insert")
    AjaxResult insert(@RequestBody Inventory inventory);

    @PutMapping("/inventory/updateInventory")
    AjaxResult updateInventory(@RequestBody Inventory inventory);

    /**
     * 获取结算账户信息详细信息
     */
    @GetMapping(value = "/account/{id}")
    AjaxResult getInfo(@PathVariable("id") Long id);
    /**
     * 修改结算账户信息
     */
    @PutMapping(value = "/account")
    AjaxResult edit(@RequestBody SettlementAccount settlementAccount);

    @GetMapping(value = "/inventory/getByBarCode/{code}")
    Inventory getByBarCode(@PathVariable("code") String code);
}
